package DBLayer;

import ModelLayer.*;

import java.util.ArrayList;

/**
 * Database interface for products
 * @author Pavel
 */

public interface IFDBProduct
{
	//get all products
	public ArrayList<Product> getAllProducts(boolean retrieveAssociation);
	
	//search a product by an id
    public Product getProductByID(int  id, boolean retrieveAssociation);
    
    //search a product by name
    public Product getProductByName(String name, boolean retrieveAssociation);
    
    //insert a product into the database
    public int insertProduct(Product prod) throws Exception;
    
    //update a product by its id
    public int updateProductByID(Product prod);
    
    //update a product by its name
    public int updateProductByName(Product prod);
    
    //delete a product from the database by its ID
    public int deleteProductByID(int id);
    
    //delete a product from the database by its name
    public int deleteProductByName(String name);
    
    //get all products for a supplier
    public ArrayList<Product> getProductsBySuppID(int suppId, boolean retrieveAssociation);
}